package com.hs.communication.mqtt.controller;

import com.hs.common.core.domain.Result;
import com.hs.common.security.annotation.InnerAuth;
import com.hs.communication.common.entity.dto.ParaDto;
import com.hs.communication.mqtt.service.MqttService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/mqtt")
public class MqttController {

    @Resource
    private MqttService mqttService;

    @InnerAuth
    @PostMapping("/parameter")
    public Result<Boolean> setParameter(@RequestBody ParaDto paraDto) {
        return Result.ok(mqttService.setParameter(paraDto));
    }
}
